<?php
	//Includes
	include("include/class.connection.php");
	include("include/functions.php");
	
	//Stat session
	session_start();
	
	//Checks if any proffesor i logged in 
	if(isset($_SESSION['proff_id']))
	{
		$subj=@$_GET['subjID'];
		
		saveGrade();
		
		
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
function altRows(id){
	if(document.getElementsByTagName){  
		
		var table = document.getElementById(id);  
		var rows = table.getElementsByTagName("tr"); 
		 
		for(i = 0; i < rows.length; i++){          
			if(i % 2 == 0){
				rows[i].className = "evenrowcolor";
			}else{
				rows[i].className = "oddrowcolor";
			}      
		}
	}
}

window.onload=function(){
	altRows('alternatecolor');
}
</script>
<link rel="stylesheet" type="text/css" href="styles/style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
	function myPopup2(str) 
	{
		window.open( "studgrades.php?subjID="+<?= $subj ?>+"&studID="+str, "myWindow", 
		"status = 1, height = 700, width = 700, resizable = 1" )
	}

</script>
</head>

<body>
<h3><a href="odsutni.php?classID=<?php echo("{$_GET['classID']}&cas={$_GET['cas']}&smena={$_GET['smena']}&subjID={$_GET['subjID']}"); ?>">Одсутни</a></h3>
<?php checkOdsutni(); 
		
?>

<?php
	printStundentCasTable();
?>
<form name="casZaverkaForm" method="post" action=<?php echo($_SERVER['PHP_SELF']."?classID={$_GET['classID']}&cas={$_GET['cas']}&smena={$_GET['smena']}&subjID={$_GET['subjID']}"); ?>>
	Внесете забелеска за часот: <br />
	<input type="text" name="zabeleskaC" width="100" height="50" />
    <input type="submit" name="casSubmit" value="Zaveri" />
</form>
<?php 
	zaveriCas();				
 ?>


</body>

<?php
	}//End if(checks if proffesor is loged in) 
?>
</html>